package edu.cmu.fithub.db.bean;

import java.util.Date;
import java.util.List;

public class Posts implements Comparable {

	private int postId;
	private int groupId;
	private String post;
	private Date date;
	private String postType;
	private List<Comments> comments;
	private User user;

	public int getPostId() {
		return postId;
	}

	public void setPostId(int postId) {
		this.postId = postId;
	}

	public String getPost() {
		return post;
	}

	public void setPost(String post) {
		this.post = post;
	}

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public int getGroupId() {
		return groupId;
	}

	public void setGroupId(int groupId) {
		this.groupId = groupId;
	}

	public String getPostType() {
		return postType;
	}

	public void setPostType(String postType) {
		this.postType = postType;
	}

	public List<Comments> getComments() {
		return comments;
	}

	public void setComments(List<Comments> comments) {
		this.comments = comments;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Override
	public int compareTo(Object o) {
		Date param_time = ((Posts)o).getDate();
		Date time = this.date;
		return (int) (param_time.getTime() - time.getTime());
	}
}
